package com.design.movieticket.common.base;

import com.design.movieticket.common.base.constant.GlobalConst;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder(toBuilder = true)
public abstract class BaseDto implements Serializable {
    private static final long serialVersionUID = 1L;

    /** 创建人 */
    @JsonSerialize(using = ToStringSerializer.class)
    protected Long createBy;

    /** 创建时间 */
    protected LocalDateTime createTime;

    /** 更新人 */
    @JsonSerialize(using = ToStringSerializer.class)
    protected Long updateBy;

    /** 更新时间 */
    protected LocalDateTime updateTime;

    /** 逻辑删除（0未删除，1已删除） */
    @Builder.Default
    protected Integer delFlag = GlobalConst.UNDEL_FLAG;
}
